<?php 
namespace app\admin\model;
use think\Model;

class NewsContent extends Model
{
	public function show()
	{
		return $this->alias('co')->field('co.id,co.title,co.time,cl.name')->join('news_classify cl','co.parentid=cl.id')->order('id','desc');
	}
	public function cou()
	{
		return $this->select()->count();
	}
	public function delnc($id)
	{
		return $this->where('id','in',$id)->delete();
	}
	public function addnc($arr)
	{
		return $this->insert($arr);
	}
	public function selone($id)
	{
		return $this->alias('co')->field('co.id,co.content,co.allimg,co.title,co.time,cl.name')->join('news_classify cl','co.parentid=cl.id')->where('co.id',$id)->select();
	}
}